<template>
    <div> 
    <el-table :data="getlist" style="width: 100%">
      <el-table-column prop="name" label="名称"  />
      <el-table-column prop="price" label="价格"  />
      <el-table-column prop="number" label="数量" />
      <el-table-column prop="shop" label="购物车" />
    </el-table>
    </div>
</template>


<script setup>
import { ref,onMounted } from "vue"
import axios from "axios"
import { ElMessage } from "element-plus"
import { useRoute } from "vue-router"
const route = useRoute()

let getlist=ref([])

const get=()=>{
    axios.get(`http://127.0.0.1:8000/goods/go/${route.params.id}/`)
    .then(res=>{
        console.log(res);
        getlist.value=[res.data,]
    })
}


onMounted(() => {
    get()
})
</script>


<style scoped> 

</style>